package com.mall.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mall.bean.Address;
import com.mall.dao.AddressMapper;
import com.mall.service.AddressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddressServiceImpl implements AddressService {

    @Autowired
    AddressMapper addressMapper;

    @Override
    public int insert(Address address) {
        return 0;
    }

    @Override
    public List<Address> queryData(Address address) {
        return null;
    }

    @Override
    public int update(Address address) {
        return 0;
    }

    @Override
    public int deleteById(String id) {
        return 0;
    }

    @Override
    public Address queryDataById(String id) {
        return null;
    }

    @Override
    public PageInfo<Address> queryDataByPage(int currentPage, int pageSize, Address address) {
        PageHelper.startPage(currentPage, pageSize);
        List<Address> addressList = addressMapper.selectByUser(address);
        PageInfo<Address> addressPageInfo=new PageInfo<>(addressList);
        return addressPageInfo;
    }

}
